<?php
session_start();

/* * SYSTEM CONFIG * */
//setlocale(LC_ALL, 'pl_PL', 'pl', 'Polish_Poland.28592');

$sys_path 	=   "C:/xampp/htdocs/bsystem";
$sys_address    =   "http://bsystem.local";

define("SEP","/");
define("SYS_PATH",$sys_path.SEP);
define("SYS_ADD",$sys_address);
define("SMARTY_DIR", SYS_PATH."smarty".SEP);
define("SMARTY_TEMPLATE_DIR", SYS_PATH."tpl".SEP);
define("SMARTY_COMPILE_DIR", SYS_PATH."compile".SEP);
define('START_TIME', microtime(true));
define('LOCAL',true); // error_handler

/*system*/
define("SYSTEM_NAME",'B-system');

/* Database settings */
define('DB_HOST','localhost');
define('DB_USER','orsino');
define('DB_ENGINE','mysql');
define('DB_PASSWORD','szapo123');
define('DB_NAME','system');
define('DB_PREFIX','tbl_');

# inkludowanie podstawowych funkcji
$inc_lib[] = SMARTY_DIR.'Smarty.class.php';
$inc_lib[] = 'function_error_handler.php'; // ?
$inc_lib[] = 'function_auto_load.php';
$inc_lib[] = 'package_url_convert.php'; // ?

foreach($inc_lib as $inc){
        $lib = SYS_PATH.'inc'.SEP.$inc;
        if(is_file($lib))
                include $lib;
        elseif(is_file($inc))
                include $inc;
}

set_error_handler('error_handler'); // ?


$system = new Bsystem();
//$agrotime->DefineMailerConfig($mailer_server, $mailer_login, $mailer_password, $mailer_email);

$system->SystemInit($dbsrv, $dbuser, $dbpass, $dbname, $dbcharset);
ob_flush();
?>